package top.lixunda.books3.service;

import top.lixunda.books3.entity.User;

public interface UserService {

    /**
     * 传入参数格式错误
     */
    int CODE_ERROR_PARAMS = 402;

    int CODE_SUCCESS = 200;

    int CODE_NO_USER = 411;

    int CODE_ERROR_PASS = 412;

    String TYPE_PHONE = "Phone";

    String TYPE_EMAIL = "email";

    String TYPE_QQ = "qq";

    String TYPE_WEIXIN = "WeChat";

    String TYPE_SINA = "Sina";

    boolean judgeAllFormat(String username, String password, String verify);

    /**
     * 系统用户登录
     */
    int tempLogin(String username, String password);

    boolean keyLogin(String loginKey);

    boolean doublePhoneUser(String phone);

    User register(String nickname, String phone, String password);

    String createLoginKey(User user);

    /**
     * 新插入一个系统用户
     * @return 成功返回系统用户， 错误返回null
     */
    User insertNewSystemUser(String nickname, String password);

    boolean judgeUserNameFormat(String username);

    boolean judgePasswordFormat(String password);

    boolean judgeLoginVerifyFormat(String verify);

    boolean judgePhoneFormat(String phone);

    boolean judgeStringFormat(String str);

}
